1. Field of the Invention
The present invention relates to a pattern drawing system, and more specifically to a circuit for detecting an end point such as a starting point and an terminating point of an arc composed of a portion of a circle or an ellipse.
2. Description of related art
Heretofore, in order to generate information for a pattern to be drawn such as a circle and ellipse at a high speed, it has been an ordinary practice to generate coordinate point values of a pattern to be required, point by point, by using a digital processing system in accordance with a circle/ellipse pattern generation algorithm known as DDA (digital differential analyzer). In the case that an arc such as a portion of a circle or ellipse is drawn in this algorithm, a starting point (Xs, Ys) and an terminating point (Xe, Ye) of the arc on a circle or ellipse to be drawn are previously given. Then, the coordinate values of the starting point and the terminating point are sequentially compared with a coordinate value (X, Y) of each point of a generated circle or ellipse pattern. Thus, the drawing is made in accordance with the generated pattern from a point of the generated pattern consistent with the given starting point to a point of the generated pattern consistent with the given terminating point. Therefore, in order to judge the consistency, it has been necessary to detect that the X coordinate and the Y coordinate of the generated pattern are consistent with the X coordinate and the Y coordinate of the start point or the end point, respectively. For example, the case of drawing an arc consisting of a portion of an ellipse as shown in FIG. 1, the X coordinate value and the Y coordinate value of the starting point and the terminating point must be precisely calculated in the following equations:
Xs or Xe=Dx cos .theta.+Xc
Ys or Ye=Dy sin .theta.+Yc
where (Xs, Ys) is coordinate of a starting point;
(Xe, Ye) is coordinate of a terminating point; PA1 (Xc, Yc) is coordinate of a center; PA1 Dx is a diameter in a X direction; PA1 Dy is a diameter in a Y direction; PA1 .theta. is an angle formed between the X axis and a line connecting between the center and the starting point or the terminating point.
The X and Y coordinates (Xs, Ys), (Xe, Ye) obtained in the equations must lie on the circumference of an ellipse generated in accordance with the DDA algorithm.
As seen from the above, the conventional method for detecting the end point of an arc has required a precise execution of complicated arithmetic operations such as trigonometric function and multiplication in order to obtain the starting point and the terminating point. This gives a large load on the software and the hardware of the pattern drawing system. In addition, a very long time is required in preprocessing for obtaining the starting point and the terminating point, with the result that the processing speed of the system is inevitably low.
Furthermore, for detecting the starting point and the terminating point, it is necessary to make comparison on both the X coordinate value and the Y coordinate value. This needs a long detection time. In addition, there is a limitation that the coordinate values of the starting point and the terminating point have to be consistent with a coordinate value lying on the circumference of a circle or ellipse generated in accordance with the DDA algorithm. However, the coordinate values generated in the DDA algorithm are obtained in the form of an integer for simplification of the digital processing, and on the other hand, the result of the operation of the function such as the trigonometric function is obtained in the form of a real number and therefore must be rounded to an approximate integer. Accordingly, approximation error is not avoidable, which would cause a deviation from a pattern to be actually obtained. In an extreme case, the starting point and/or the terminating point could not be detected due to the approximation error, with the result that a required arc could not obtained, or an operation would continue to circulate in a straying loop which will not terminate.